package com.perceptivesoftware.licensing.client.common.util;

import com.google.gwt.user.client.rpc.IsSerializable;

public enum NPAction implements IsSerializable
{
	// Actual entity name is used for the node labels of entity lists

	SUPER_ADMIN(1L, "Super Administrator"), // Is this too insecure?

	/* Administrative */
	MANAGE_SECURITY(2L, "User Administration");

	private Long type;
	private String desc;

	private NPAction(final Long type, final String desc)
	{
		this.type = type;
		this.desc = desc;
	}

	public Long getType()
	{
		return type;
	}

	public String getDesc()
	{
		return desc;
	}

	public static NPAction getEnumForAction(final Long type)
	{
		for (final NPAction theEnum : NPAction.values())
		{
			if (theEnum.getType().equals(type))
			{
				return theEnum;
			}
		}
		return null;
	}
}
